﻿function log<T>(target: T) {
    console.log(`Logging: ${target}`);
}

@log
class ClassWithLog {
    constructor(private name: string) {}

    greet() {
        console.log(`Hello, ${this.name}!`);
    }
}

const instance = new ClassWithLog("Alice");
instance.greet(); // 输出: Hello, Alice!
